package com.imcoke.abchat.web.mapper;

import com.imcoke.abchat.domain.Log;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

/**
 * @Author ccoke
 * @Description
 * @Date: 13:03 2017-11-30
 */
@Mapper
public interface LogMapper {
    @Insert("INSERT INTO tb_log VALUES(null,#{username},#{info},#{time},#{ip})")
    int insertLog(Log log);

    @Delete("DELETE FROM tb_log WHERE time <= #{date}")
    int deleteLogsBeforeThreeMonth(@Param("date") Date date);
}
